home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4123 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  45 lines

  1. Path: daily-planet.execpc.com!usenet
  2. From: maniac@execpc.com (Paul Voight)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: 256 colors in BCG
  5. Date: 2 Feb 1996 02:13:15 GMT
  6. Organization: Exec-PC Internet
  7. Message-ID: <4errvr$f0o@daily-planet.execpc.com>
  8. References: <4enojq$4j@badger.wmin.ac.uk>
  9. NNTP-Posting-Host: eddie.execpc.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14. In article <4enojq$4j@badger.wmin.ac.uk>, kruppd@westminster.ac.uk says...
  15. >
  16. >I am using a borland compiler and want to write images to the screen
  17. >with 256 grey levels or alternatively 256 graded in a recognisable way 
  18. >eg. rainbow. I know that in mode 13h I have acess to 256 colors 
  19. >but at a lower resolution then vga. Also accessing mode 13h means 
  20. >writing some assembly code. Is there a library on the net which will 
  21. >give me 256 grey levels that can be called from a standard c programme.
  22. >thanks 
  23. >Declan Kruppa
  24. >
  25.  
  26. Use this function I wrote using in line asm.
  27.  
  28. void setmode(int mode)
  29. {
  30.    asm{
  31.     mov AH, 0
  32.     mov AL, BYTE PTR mode
  33.     int 10h
  34.       }
  35. }
  36.  
  37. use 13h for 320x200 256 color
  38. use 03h for text again
  39.  
  40. setmode(0x13); /* 320x200 */
  41. setmode(0x03); /* Text mode */
  42.  
  43. hope this helps
  44.  
  45.